<template>
  <div>
    子组件
    <!-- <button @click="$emit('myclick',100)">按钮</button> -->
    <button @click="fn">按钮</button>
  </div>
</template>

<script>
// 模板中不能写this，js中必须要加this
// computed methods this
export default {
  data() {
    return {};
  },
  methods: {
    fn() {
      this.$emit("myclick", 100);
    },
  },
};
</script>

<style scoped></style>
